package com.zmn.oms.dubbo.interfaces.zmn.normal.warranty;

import com.zmn.common.dto2.ResponseDTO;
import com.zmn.oms.dubbo.dto.zmn.warranty.OrderWarrantyListDRO;
import com.zmn.oms.dubbo.dto.zmn.warranty.WarrantyListUserDRO;
import com.zmn.oms.dubbo.dto.zmn.warranty.WarrantyUserDRO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;
import java.util.Set;

/**
 * 类描述： 保修卡
 *
 * @author yule
 * @date 2020/7/30 16:44
 */
@Api(value = "保修卡接口", tags = {"保修卡接口"})
public interface ZsNormalOrderWarrantyRemoteService {

    /**
     * 获取保修卡
     * @param orderId
     * @return
     */
    ResponseDTO<WarrantyUserDRO> findWarrantyByOrderId(Long orderId);

    /**
     * 获取保修卡（不校验工单状态）
     * sass服务验收接口使用，完成前要展示保修信息
     * @param orderId
     * @return
     */
    ResponseDTO<WarrantyUserDRO> findAllWarrantyByOrderId(Long orderId);


    /**
     * 获取保修卡列表
     *
     * @param orderIds
     * @return
     */
    ResponseDTO<List<OrderWarrantyListDRO>> listWarrantyByOrderIds(@NotEmpty Set<Long> orderIds);

    /**
     * 获取保修卡详情
     *
     * @param orderId 订单号
     * @param code    保修卡号
     * @return
     */
    @ApiOperation(value = "查询保修卡详情")
    ResponseDTO<WarrantyUserDRO> findWarrantyDetailByOrderIdAndCode(@NotNull(message = "orderId不能为空") Long orderId,
                                                                    @NotNull(message = "code保修卡号不能为空") String code);

    /**
     * 保修卡列表
     * @param userId
     * @return
     */
    @ApiOperation(value = "查询保修卡列表")
    ResponseDTO<List<WarrantyListUserDRO>> listWarrantyByUserId(Long userId);

    /**
     * 多用户查询保修卡列表
     *
     * @param userIdList
     * @return
     */
    ResponseDTO<List<WarrantyListUserDRO>> listWarrantyByUserIds(@NotEmpty Set<Long> userIdList);

    /**
     * 激活保单
     * @param orderId 用户id
     * @return 激活结果
     */
    ResponseDTO activeWarranty(Long orderId);

    /**
     * 领取保修卡
     * @param orderId
     * @param userId
     * @return
     */
    ResponseDTO takeWarranty(Long orderId, Long userId);
}